#---------------------------------------------------------------------------------------------------------------------
# Audio backend setup:
#---------------------------------------------------------------------------------------------------------------------
ifeq ($(strip $(AUDIOBACKEND)),)
    AUDIOBACKEND = maxmod
endif

ifeq ($(strip $(AUDIOBACKEND)),null)
#---------------------------------------------------------------------------------------------------------------------
    BN_AUDIO_BACKEND_CFLAGS	:=	-DBN_AUDIO_BACKEND_NULL
#---------------------------------------------------------------------------------------------------------------------
else
ifeq ($(strip $(AUDIOBACKEND)),maxmod)
#---------------------------------------------------------------------------------------------------------------------
    BN_AUDIO_BACKEND_CFLAGS	:=	-DBN_AUDIO_BACKEND_MAXMOD -D__GBA__
	
ifeq ($(strip $(AUDIOTOOL)),)
    AUDIOTOOL = $(BN_MMUTIL)
endif
#---------------------------------------------------------------------------------------------------------------------
else
ifeq ($(strip $(AUDIOBACKEND)),aas)
#---------------------------------------------------------------------------------------------------------------------
    BN_AUDIO_BACKEND_CFLAGS	:=	-DBN_AUDIO_BACKEND_AAS
	
ifeq ($(strip $(AUDIOTOOL)),)
    AUDIOTOOL = conv2aas
endif
#---------------------------------------------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------------------------------------------
    $(error "Unsupported audio backend: $(AUDIOBACKEND)")
#---------------------------------------------------------------------------------------------------------------------
endif
endif
endif

#---------------------------------------------------------------------------------------------------------------------
# DMG audio backend setup:
#---------------------------------------------------------------------------------------------------------------------
ifeq ($(strip $(DMGAUDIOBACKEND)),)
    DMGAUDIOBACKEND = default
endif

ifeq ($(strip $(DMGAUDIOBACKEND)),null)
#---------------------------------------------------------------------------------------------------------------------
    BN_AUDIO_BACKEND_CFLAGS	+=	-DBN_DMG_AUDIO_BACKEND_NULL
#---------------------------------------------------------------------------------------------------------------------
else
ifeq ($(strip $(DMGAUDIOBACKEND)),default)
#---------------------------------------------------------------------------------------------------------------------
    BN_AUDIO_BACKEND_CFLAGS	+=	-DBN_DMG_AUDIO_BACKEND_DEFAULT
#---------------------------------------------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------------------------------------------
    $(error "Unsupported DMG audio backend: $(DMGAUDIOBACKEND)")
#---------------------------------------------------------------------------------------------------------------------
endif
endif
